<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><% model(2); %></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="15" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="php.js"></script>
<script type="text/javascript" src="config.js"></script>
<script type="text/javascript" src="general.js"></script>
<!-- {{{ --><script type="text/javascript">wl = <% wl_status(); %>;</script><!-- }}} -->
<script type="text/javascript">
	var wl_mode = ["Access Point", "AP + WDS", "WDS", "Station", "Ethernet Bridge"];
	$(document).ready(function() {
		load_body();
		if (wl.radio != 1) {
			$('#wl0_mode').html('Radio is disabled');
			$('#wl0_channel, #wl0_status, #wl0_ap, #wl0_signal, #wl0_stations').parent().remove();
		}
		else {
			$('#wl0_mode').html(wl_mode[wl.mode]);
			$('#wl0_channel').html(wl.channel);
			switch (wl.mode) {
				case 3:
				case 4:
					$('#wl0_status').html(wl.status);
					$('#wl0_ap').html(wl.ap);
					$('#wl0_signal').html(sprintf('%d dBm', wl.signal));
					$('#wl0_stations').parent().remove();
					break;
				default:
					$('#wl0_status, #wl0_ap, #wl0_signal').parent().remove();
					$('#wl0_stations').html('<table class="list2"><tr><th>MAC<\/th><th>Band<\/th><th>Joined<\/th><th>Idle<\/th><th>Signal<\/th><th>TX<\/th><th>RX<\/th><th>PS<\/th><\/tr><\/table>');
					for (i in wl.stations) {
						$(sprintf('<tr><td>%s<\/td><td>%s<\/td><td>%s<\/td><td>%s<\/td><td>%d dBm<\/td><td>%s Mbps<\/td><td>%s Mbps<\/td><td>%s<\/td><\/tr>', wl.stations[i].mac, wl.stations[i].band, wl.stations[i].joined, wl.stations[i].idle, wl.stations[i].rssi, wl.stations[i].tx_rate, wl.stations[i].rx_rate, wl.stations[i].ps ? 'On' : 'Off')).appendTo('#wl0_stations table').find('td').css('background-color', wl.stations[i].autho ? wl.stations[i].band == 'N' ? '#99ff99' : '#ffcc99' : '#ff9999');
					}
					break;
			}
		}
	});
</script>
</head>
<body>
<form method="get" name="form" id="form" action="apply.cgi">
<input type="hidden" name="current_page" value="wifistatus.asp" />
<input type="hidden" name="next_page" value="wifistatus.asp" />
<input type="hidden" name="next_host" value="" />
<input type="hidden" name="group_id" value="" />
<input type="hidden" name="modified" value="0" />
<input type="hidden" name="action_mode" value="" />
<input type="hidden" name="first_time" value="" />
<input type="hidden" name="action_script" value="" />

<table class="main">
<thead>
<tr>
<td>Status &amp; Log - WiFi Interface</td>
</tr>
</thead>

<tr><td>
<table class="sect">
<tr>
<th>MAC Address:
           </th><td id="wl0_hwaddr"><% nvram_get("wl0_hwaddr"); %></td>
</tr>
<tr>
<th>Mode:
           </th><td id="wl0_mode"></td>
</tr>
<tr>
<th>Channel:
           </th><td id="wl0_channel"></td>
</tr>
<tr>
<th>Status:
           </th><td id="wl0_status"></td>
</tr>
<tr>
<th>AP:
           </th><td id="wl0_ap"></td>
</tr>
<tr>
<th>Signal:
           </th><td id="wl0_signal"></td>
</tr>
<tr>
<td colspan="2" id="wl0_stations"></td>
</tr>
<tr>
<th>Radio Control:
           </th><td><input type="submit" maxlength="15" class="content_input_button" onClick="return onSubmitApply('radio_disable')" size="12" name="WLANConfig11b_WirelessCtrl_button" value="Disable" /><input type="submit" maxlength="15" class="content_input_button" onClick="return onSubmitApply('radio_enable')" size="12" name="WLANConfig11b_WirelessCtrl_button1" value="Enable" /></td>
</tr>
</table>
</td></tr>

</table>
	
<table class="foot">
<tr>  
   <td height="25" width="75%">&nbsp;</td>
   <td height="25">  
   <div align="center"><font face="Arial"> <input class="inputSubmit" onClick="onSubmitCtrl(this, ' Refresh ')" type="submit" value="Refresh" name="action" /></font></div> 
   </td>
</tr>
</table>

</form>
</body>
</html>